package com.cjm.one.model.goods.entity;

import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;

import com.cjm.one.model.base.BaseEntity;
import com.cjm.one.model.goods.enums.GoodsInfoAuditStatusEnum;
import com.cjm.one.model.goods.enums.GoodsInfoIsHotEnum;
import com.cjm.one.model.goods.enums.GoodsInfoIsNewEnum;
import com.cjm.one.model.goods.enums.GoodsInfoStatusEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.math.BigDecimal;

/**
 * 
 * @TableName goods_info
 */
@TableName(value ="goods_info")
@Data
public class GoodsInfo extends BaseEntity {
    /**
     * 
     */
//    @TableId(type = IdType.AUTO)
//    private Long id;

    /**
     * 商品名称
     */
    @TableField("good_name")
    @Schema(description = "商品名称")

    private String goodName;

    /**
     * 品牌id
     */
    @TableField("brand_id")
    @Schema(description = "品牌id")
    private Long brandId;
    /**
     * 品牌名称
     */
    @Schema(description = "品牌名称")
    @TableField("brand_name")
    private String brandName;

    /**
     * 一级分类id
     */
    @TableField("category1_id")
    @Schema(description = "一级分类id")
    private Long category1Id;

    /**
     * 二级分类id
     */
    @TableField("category2_id")
    @Schema(description = "二级分类id")
    private Long category2Id;

    /**
     * 三级分类id
     */
//    @TableField("category3_id")
//    @Schema(description = "三级分类id")
//    private Long category3Id;

    /**
     * 商品简介
     */
    @TableField("introduction")
    @Schema(description = "商品简介")
    private String introduction;

    /**
     * 商品轮播图
     */
    @TableField("slider_urls")
    @Schema(description = "商品轮播图")
    private String sliderUrls;

    /**
     * 商品规格json
     */
    @TableField("spec_value")
    @Schema(description = "商品规格json")
    private String specValue;

    /**
     * 线上状态：0-初始值，1-上架，-1-自主下架
     */
    @TableField("status")
    @Schema(description = "线上状态：0-初始值，1-上架，-1-自主下架")
    private GoodsInfoStatusEnum status;

    /**
     * 审核状态：0-初始值，1-通过，-1-未通过
     */
    @TableField("audit_status")
    @Schema(description = "审核状态：0-初始值，1-通过，-1-未通过")
    private GoodsInfoAuditStatusEnum auditStatus;

    /**
     * 审核信息
     */
    @TableField("audit_message")
    @Schema(description = "审核信息")
    private String auditMessage;
//    产地
    @TableField("origin")
    private String origin;
    //酒精度
    @TableField("alcohol_content")
    @Schema(description = "酒精度")
    private BigDecimal alcoholContent;

//    净含量
    @TableField("net_content")
    @Schema(description = "净含量")
    private Integer netContent;

    @TableField("sales_volume")
    private Long salesVolume;

    /**
     * 商品详情html
     */
    @TableField("details")
    @Schema(description = "商品详情html")
    private String details;

    /**
     * 是否推荐商品 0 否 1是
     */
    @TableField("id_hot")
    @Schema(description = "是否推荐商品 0 否 1是")
    private GoodsInfoIsHotEnum idHot;
    @TableField("is_new")
    @Schema(description = "是否新品商品 0 否 1是")
    private GoodsInfoIsNewEnum isNew;

    /**
     * 删除标记（0:不可用 1:可用）
     */
//    private Integer isDeleted;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        GoodsInfo other = (GoodsInfo) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getGoodName() == null ? other.getGoodName() == null : this.getGoodName().equals(other.getGoodName()))
            && (this.getBrandId() == null ? other.getBrandId() == null : this.getBrandId().equals(other.getBrandId()))
            && (this.getCategory1Id() == null ? other.getCategory1Id() == null : this.getCategory1Id().equals(other.getCategory1Id()))
            && (this.getCategory2Id() == null ? other.getCategory2Id() == null : this.getCategory2Id().equals(other.getCategory2Id()))
//            && (this.getCategory3Id() == null ? other.getCategory3Id() == null : this.getCategory3Id().equals(other.getCategory3Id()))
            && (this.getIntroduction() == null ? other.getIntroduction() == null : this.getIntroduction().equals(other.getIntroduction()))
            && (this.getSliderUrls() == null ? other.getSliderUrls() == null : this.getSliderUrls().equals(other.getSliderUrls()))
            && (this.getSpecValue() == null ? other.getSpecValue() == null : this.getSpecValue().equals(other.getSpecValue()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getAuditStatus() == null ? other.getAuditStatus() == null : this.getAuditStatus().equals(other.getAuditStatus()))
            && (this.getAuditMessage() == null ? other.getAuditMessage() == null : this.getAuditMessage().equals(other.getAuditMessage()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getDetails() == null ? other.getDetails() == null : this.getDetails().equals(other.getDetails()))
            && (this.getIdHot() == null ? other.getIdHot() == null : this.getIdHot().equals(other.getIdHot()))
            && (this.getIsDeleted() == null ? other.getIsDeleted() == null : this.getIsDeleted().equals(other.getIsDeleted()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getGoodName() == null) ? 0 : getGoodName().hashCode());
        result = prime * result + ((getBrandId() == null) ? 0 : getBrandId().hashCode());
        result = prime * result + ((getCategory1Id() == null) ? 0 : getCategory1Id().hashCode());
        result = prime * result + ((getCategory2Id() == null) ? 0 : getCategory2Id().hashCode());
//        result = prime * result + ((getCategory3Id() == null) ? 0 : getCategory3Id().hashCode());
        result = prime * result + ((getIntroduction() == null) ? 0 : getIntroduction().hashCode());
        result = prime * result + ((getSliderUrls() == null) ? 0 : getSliderUrls().hashCode());
        result = prime * result + ((getSpecValue() == null) ? 0 : getSpecValue().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getAuditStatus() == null) ? 0 : getAuditStatus().hashCode());
        result = prime * result + ((getAuditMessage() == null) ? 0 : getAuditMessage().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getDetails() == null) ? 0 : getDetails().hashCode());
        result = prime * result + ((getIdHot() == null) ? 0 : getIdHot().hashCode());
        result = prime * result + ((getIsDeleted() == null) ? 0 : getIsDeleted().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(this.getId());
        sb.append(", goodName=").append(goodName);
        sb.append(", brandId=").append(brandId);
        sb.append(", category1Id=").append(category1Id);
        sb.append(", category2Id=").append(category2Id);
//        sb.append(", category3Id=").append(category3Id);
        sb.append(", introduction=").append(introduction);
        sb.append(", sliderUrls=").append(sliderUrls);
        sb.append(", specValue=").append(specValue);
        sb.append(", status=").append(status);
        sb.append(", auditStatus=").append(auditStatus);
        sb.append(", auditMessage=").append(auditMessage);
        sb.append(", updateTime=").append(this.getUpdateTime());
        sb.append(", createTime=").append(this.getCreateTime());
        sb.append(", details=").append(details);
        sb.append(", idHot=").append(idHot);
        sb.append(", isDeleted=").append(this.getIsDeleted());
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}